package com.sc.springboot.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.text.DateFormat;
import java.util.Date;

@Controller
public class NowController {

    @RequestMapping(value = "now")
    public String now(Model m){
        m.addAttribute("now", DateFormat.getDateTimeInstance().format(new Date()));
        return "now";   //和jsp文件名对应
    }
}
